#include "sdObject.h"
#include "sdInput.h"
#include "sdUniverse.h"
#include "sdGraphics.h"
#include <iostream>
#include <sstream>
using namespace std;
int main(int argc, const char **argv) {
    sdUniverse* u;
    cpInitChipmunk();
    if(argc == 1){
        cout << "default u\n";
        u = new sdUniverse(WIDTH, HEIGHT);
    }
    else if (argc == 5){
        int a1, a2, a3, a4;
        istringstream is1(argv[1]);
        is1 >> a1;
        istringstream is2(argv[2]);
        is2 >> a2;
        istringstream is3(argv[3]);
        is3 >> a3;
        istringstream is4(argv[4]);
        is4 >> a4;
        u = new sdUniverse(WIDTH, HEIGHT, a1, a2, a3, a4); 
    }
    else
        std::cerr << "Only command line args are ip address seperated by spaces instead of dots or nothing\n";
    sdGraphics::init(u, WIDTH, HEIGHT, argc, argv); 
    glutMainLoop();

    return 0;
}
